<template>
    <van-nav-bar title="手机号" right-text="企业注册" left-arrow @click-left="onClickLeft" />
    <van-image width="10rem" height="10rem" fit="cover" position="left" style="margin-left: 14rem; margin-top: 4rem;"
        src="https://fastly.jsdelivr.net/npm/@vant/assets/cat.jpeg" />
    <van-field v-model="result" readonly name="area" label="国家/地区" placeholder="中国(+86)" />
    <van-form @submit="onSubmit">

        <van-cell-group inset>
            <van-field v-model="username" name="username" label="用户名" placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]" />
            <van-field v-model="password" type="password" name="password" label="密码" placeholder="密码"
                :rules="[{ required: true, message: '请填写密码' }]" />
        </van-cell-group>

<div>
    <van-checkbox v-model="checked">我已阅读并同意《京东隐藏政策》《京东用户服务协议》</van-checkbox>
</div>
        <div style="margin: 16px;">
            <van-button round block type="primary" native-type="submit">
                同意协议并提交
            </van-button>
        </div>
    </van-form>
    <p>遇到问题? 您可以获取帮助</p>
</template>

<script setup>
import { registerAPi } from '@/api/api'
import { useRouter ,useRoute} from 'vue-router';
import { ref } from 'vue';
    import { showToast } from 'vant';
const router =useRouter()
const username = ref('');
const password = ref('');
const onSubmit = (values) => {
    console.log('submit', values);
    registerAPi().then(res=>{
        console.log('shuj',res);
        
    })



showToast('恭喜您提交成功');
    router.push('home/my')
};
</script>

<style lang="scss" scoped></style>